// pages/cart/cart.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    nbTitle: '新标题',
    nbLoading: true,
    nbFrontColor: '#ffffff',
    nbBackgroundColor: '#000000',
    latitude: 23.098994,
    longitude: 113.322520,
    markerData:[
    {
      id: 1,
      latitude: 23.098994,
      longitude: 113.322520,
      iconPath: '../../img/cao.jpg',
      callout: { //点的气泡
        content: '我们公司在这',
        color: '#ff0000',
        fontSize: 14,
        borderWidth: 2,
        borderRadius: 10,
        borderColor: '#000000',
        bgColor: '#fff',
        padding: 5,
        display: 'ALWAYS',
        textAlign: 'center'
      }
    },
    {
      id: 2,
      latitude: 23.0148994,
      longitude: 113.322520,
      iconPath: '../../img/cao.jpg',
      callout: { //点的气泡
        content: '广州',
        color: '#ff0000',
        fontSize: 14,
        borderWidth: 2,
        borderRadius: 10,
        borderColor: '#000000',
        bgColor: '#fff',
        padding: 5,
        display: 'ALWAYS',
        textAlign: 'center'
      }
    }
  ],
  polyline: [{
    //连线点 第一个可以为默认的连线点
    points: [ 
     {
      latitude: 23.098994,
      longitude: 113.322520,
    }, {
      latitude: 23.0148994,
      longitude: 113.322520,
    }, {
      latitude:'23.19586005538885',
      longitude:'113.93735297268154'
    }
  ],
    color:'#8AC349',
    width:10,
    zIndex: 1
  }]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    // 元素拾取器
    // const query = wx.createSelectorQuery()
    //let mycan=query.select('#mycanvas')
    var context = wx.createCanvasContext('firstCanvas')
    context.setStrokeStyle("#00ff00")
    context.setLineWidth(5)
    context.rect(0, 0, 200, 200)
    context.stroke()
    context.setStrokeStyle("#ff0000")
    context.setLineWidth(2)
    context.moveTo(160, 100)
    context.arc(100, 100, 60, 0, 2 * Math.PI, true)
    context.moveTo(140, 100)
    context.arc(100, 100, 40, 0, Math.PI, false)
    context.moveTo(85, 80)
    context.arc(80, 80, 10, 0, 2 * Math.PI, true)
    context.moveTo(125, 80)
    context.arc(120, 80, 10, 0, 2 * Math.PI, true)
    context.stroke()
    context.draw()
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})